cmake_minimum_required(VERSION 3.5)

set(PROJECT_DIR ".")
set(PROJECT_NAME audioutils)
project(${PROJECT_NAME} LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5 COMPONENTS Core REQUIRED)
find_package(Qt5 COMPONENTS Widgets REQUIRED)

# include files
FILE(GLOB SRC_FILES ${PROJECT_DIR}/*.cpp)
FILE(GLOB HEAD_FILES ${PROJECT_DIR}/*.h)

add_library(${PROJECT_NAME} SHARED ${SRC_FILES} ${HEAD_FILES})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR})

target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} PRIVATE sndfile-shared)
target_link_libraries(${PROJECT_NAME} PRIVATE fft)

target_compile_definitions(${PROJECT_NAME} PRIVATE AUDIOUTILS_LIBRARY)
